
/* First created by JCasGen Mon Mar 28 12:51:53 CEST 2011 */
package ia1011.zanzibar.chaos.type;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;

/** A Lemma represents an morphosyntactic and semantic interpretation (generally obtained in a dictionary) of a token or a token span.
 * Updated by JCasGen Mon Mar 28 12:52:46 CEST 2011
 * @generated */
public class UimaComplexConstituent_Type extends UimaConstituent_Type {
  /** @generated */
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator = 
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (UimaComplexConstituent_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = UimaComplexConstituent_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new UimaComplexConstituent(addr, UimaComplexConstituent_Type.this);
  			   UimaComplexConstituent_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new UimaComplexConstituent(addr, UimaComplexConstituent_Type.this);
  	  }
    };
  /** @generated */
  public final static int typeIndexID = UimaComplexConstituent.typeIndexID;
  /** @generated 
     @modifiable */
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("ia1011.zanzibar.chaos.type.UimaComplexConstituent");
 
  /** @generated */
  final Feature casFeat_subconstituents;
  /** @generated */
  final int     casFeatCode_subconstituents;
  /** @generated */ 
  public int getSubconstituents(int addr) {
        if (featOkTst && casFeat_subconstituents == null)
      jcas.throwFeatMissing("subconstituents", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    return ll_cas.ll_getRefValue(addr, casFeatCode_subconstituents);
  }
  /** @generated */    
  public void setSubconstituents(int addr, int v) {
        if (featOkTst && casFeat_subconstituents == null)
      jcas.throwFeatMissing("subconstituents", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    ll_cas.ll_setRefValue(addr, casFeatCode_subconstituents, v);}
    
   /** @generated */
  public int getSubconstituents(int addr, int i) {
        if (featOkTst && casFeat_subconstituents == null)
      jcas.throwFeatMissing("subconstituents", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subconstituents), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_subconstituents), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subconstituents), i);
  }
   
  /** @generated */ 
  public void setSubconstituents(int addr, int i, int v) {
        if (featOkTst && casFeat_subconstituents == null)
      jcas.throwFeatMissing("subconstituents", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subconstituents), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_subconstituents), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subconstituents), i, v);
  }
 
 
  /** @generated */
  final Feature casFeat_head;
  /** @generated */
  final int     casFeatCode_head;
  /** @generated */ 
  public int getHead(int addr) {
        if (featOkTst && casFeat_head == null)
      jcas.throwFeatMissing("head", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    return ll_cas.ll_getRefValue(addr, casFeatCode_head);
  }
  /** @generated */    
  public void setHead(int addr, int v) {
        if (featOkTst && casFeat_head == null)
      jcas.throwFeatMissing("head", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    ll_cas.ll_setRefValue(addr, casFeatCode_head, v);}
    
  
 
  /** @generated */
  final Feature casFeat_governor;
  /** @generated */
  final int     casFeatCode_governor;
  /** @generated */ 
  public int getGovernor(int addr) {
        if (featOkTst && casFeat_governor == null)
      jcas.throwFeatMissing("governor", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    return ll_cas.ll_getRefValue(addr, casFeatCode_governor);
  }
  /** @generated */    
  public void setGovernor(int addr, int v) {
        if (featOkTst && casFeat_governor == null)
      jcas.throwFeatMissing("governor", "ia1011.zanzibar.chaos.type.UimaComplexConstituent");
    ll_cas.ll_setRefValue(addr, casFeatCode_governor, v);}
    
  



  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public UimaComplexConstituent_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

 
    casFeat_subconstituents = jcas.getRequiredFeatureDE(casType, "subconstituents", "uima.cas.FSArray", featOkTst);
    casFeatCode_subconstituents  = (null == casFeat_subconstituents) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_subconstituents).getCode();

 
    casFeat_head = jcas.getRequiredFeatureDE(casType, "head", "ia1011.zanzibar.chaos.type.UimaConstituent", featOkTst);
    casFeatCode_head  = (null == casFeat_head) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_head).getCode();

 
    casFeat_governor = jcas.getRequiredFeatureDE(casType, "governor", "ia1011.zanzibar.chaos.type.UimaConstituent", featOkTst);
    casFeatCode_governor  = (null == casFeat_governor) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_governor).getCode();

  }
}



    